class Lodash {
    constructor() {

    }
    concat(array) {

        if (!Array.isArray(array)) return []
        let args = Array.prototype.slice.call(arguments, 1)
        let newArr = array.slice(0);
        for (let i = 0; i < args.length; i++) {
            if (Array.isArray(args[i])) {
                newArr = newArr.concat(args[i])
            } else {
                newArr.push(args[i])
            }
        }
        return newArr
    }
}

const l = new Lodash()



var array = [1];
var other = l.concat(array, 2, [3],[[[4]]]);
 
console.log(other);
// => [1, 2, 3, [4]]
 
console.log(array);
// => [1]

